package com.rop.znyx.product;

import com.rop.znyx.common.result.Result;
import com.rop.znyx.enums.SkuType;
import com.rop.znyx.model.product.Category;
import com.rop.znyx.model.product.SkuInfo;
import com.rop.znyx.vo.product.SkuInfoVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 * User: Rop
 * Date: 2023/6/30
 * Time: 15:00
 * Description:
 */

@FeignClient(value = "service-product")
public interface ProductFeignClient {

    @GetMapping("api/product/inner/getCategory/{categoryId}")
    Result<Category> getCategory(@PathVariable Long categoryId);

    @GetMapping("api/product/inner/getSkuInfo/{skuId}")
    Result<SkuInfo> getSkuInfo(@PathVariable Long skuId);

    @PostMapping("api/product/inner/findSkuInfoList")
    Result<List<SkuInfo>> findSkuInfoList(@RequestBody List<Long> skuIds);

    @GetMapping("api/product/inner/findSkuInfoByKeyword/{keyword}")
    Result<List<SkuInfo>> findSkuInfoByKeyword(@PathVariable("keyword") String keyword);

    @PostMapping("api/product/inner/findCategoryList")
    Result<List<Category>> findCategoryList(@RequestBody List<Long> categoryIdList);

    /**
     * 更新秒杀商品
     */
    @PostMapping("api/product/inner/updateSkuType")
    void updateSkuType(@RequestParam List<Long> skuIdList, @RequestParam SkuType skuType);

    /**
     * 获取分类信息
     */
    @GetMapping("api/product/inner/findAllCategoryList")
    Result<List<Category>> findAllCategoryList();

    /**
     * 获取新人专享商品
     */
    @GetMapping("api/product/inner/findNewPersonSkuInfoList")
    Result<List<SkuInfo>> findNewPersonSkuInfoList();

    @ApiOperation(value = "根据skuId获取sku信息")
    @GetMapping("api/product/inner/getSkuInfoVo/{skuId}")
    Result<SkuInfoVo> getSkuInfoVo(Long skuId);
}
